package com.itheima;

import com.itheima.config.SpringConfig;
import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class UserApp {
    public static void main(String[] args) {
//        1. 获取ioc
        ApplicationContext ioc = new
                AnnotationConfigApplicationContext(SpringConfig.class);
//        2. 获取业务bean
        UserMapper bean = ioc.getBean(UserMapper.class);
//        3. 放法执行
        System.out.println(bean.findById(1));
    }
}
